<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglib.jsp"%>
<!doctype html>
<html class="x-border-box x-strict x-viewport">
<head>
<%@ include file="/common/head-system.jsp"%>
<title>录入</title>
<script type="text/javascript">
	window.refreshQuery = function() {
		location.reload();
	};
	jQuery(function() {
	});
</script>
</head>
<body class="x-body x-reset x-border-layout-ct x-container">
	<form action="save.do" method="post" id="mainForm">
		<s:token />
		<s:hidden name="id" />
		<ext:panel head="录入">
			<ext:formField labelname="包路径" fieldname="packageText">
				<s:textfield name="packageText" cssClass="x-form-field x-form-text"
					cssStyle="width: 100%;" />
			</ext:formField>
			<ext:formField labelname="是否有表前缀" fieldname="hasPrefix">
				<s:radio name="hasPrefix" list="#application.M.getDictByType('yn')" listKey="code" listValue="name" />
			</ext:formField>
			<ext:formField labelname="表前缀" fieldname="prefixText">
				<s:textfield name="prefixText" cssClass="x-form-field x-form-text"
					cssStyle="width: 100%;" />
			</ext:formField>
			<ext:formField labelname="名称" fieldname="nameText">
				<s:textfield name="nameText" cssClass="x-form-field x-form-text"
					cssStyle="width: 100%;" />
			</ext:formField>
			<ext:formField labelname="显示名称" fieldname="nameShow">
				<s:textfield name="nameShow" cssClass="x-form-field x-form-text"
					cssStyle="width: 100%;" />
			</ext:formField>
			<ext:formField labelname="表名" fieldname="tableName">
				<s:textfield name="tableName" cssClass="x-form-field x-form-text"
					cssStyle="width: 100%;" />
			</ext:formField>
			<ext:formField labelname="备注" fieldname="commentText">
				<s:textfield name="commentText" cssClass="x-form-field x-form-text"
					cssStyle="width: 100%;" />
			</ext:formField>
			<ext:formField labelname="是否有效" fieldname="isWork">
				<s:radio name="isWork" list="#application.M.getDictByType('yn')" listKey="code" listValue="name" />
			</ext:formField>
			<ext:formField labelname="是否隶属于集合" fieldname="isParentMapping">
				<s:radio name="isParentMapping" list="#application.M.getDictByType('yn')" listKey="code" listValue="name" />
			</ext:formField>
			<ext:formField labelname="父元素" fieldname="parentId">
				<s:textfield name="parentId" cssClass="x-form-field x-form-text"
					cssStyle="width: 100%;" />
			</ext:formField>
		</ext:panel>
		<br />
		<ext:panel head="列表">
			<div class="my-grid">
			<table cellpadding="0" border="0" cellspace="0" width="100%">
				<tr>
					<td width="30"><ext:gridHeadCell>
							序号
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							主键
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							名称
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							显示名称
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							类型
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							列名
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							是否必填项
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							默认值
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							是否主键
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							sequence
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							备注
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							是否唯一
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							长度
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							位数
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							小数位数
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							是否显示
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							是否有效
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							是否查询
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							字典类别
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							关联实体
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							关联属性
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							关联表
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							关联列
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							日期格式
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							显示日期格式
						</ext:gridHeadCell>
					</td>
					<td><ext:gridHeadCell>
							实体
						</ext:gridHeadCell>
					</td>
					<td width="50"><ext:gridHeadCell align="center">
							操作
						</ext:gridHeadCell>
					</td>
				</tr>
				<s:iterator value="properties" id="vo" status="s">
					<s:if test="#s.count%2 == 1">
						<s:set name="rc" value="''" />
					</s:if>
					<s:else>
						<s:set name="rc" value="' x-grid-row-alt'" />
					</s:else>
					<tr class="x-grid-row<s:property value='rc' />">
						<td style="padding-left: 0px;"
							class=" x-grid-cell x-grid-cell-special x-grid-cell-first"><div
								style="text-align: right; font-weight: bolder;"
								class="x-grid-cell-inner">
								<s:property value="#s.count" />
							</div></td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.id" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.nameText" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.nameShow" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.propertyType" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.columnName" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#application.M.getDictNameByTypeAndCode(#vo.isNotNull, 'yn')" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.defaultValue" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#application.M.getDictNameByTypeAndCode(#vo.isKey, 'yn')" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.sequenceName" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.commentText" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#application.M.getDictNameByTypeAndCode(#vo.isUnique, 'yn')" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.lengthValue" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.precisionValue" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.scaleValue" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#application.M.getDictNameByTypeAndCode(#vo.isShow, 'yn')" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#application.M.getDictNameByTypeAndCode(#vo.isWork, 'yn')" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#application.M.getDictNameByTypeAndCode(#vo.isQuery, 'yn')" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.dictType" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.refEntity" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.refProperty" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.refTable" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.refColumn" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.dateFormat" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.dateFormatShow" />
							</div>
						</td>
						<td class=" x-grid-cell"><div style="text-align: left;"
								class="x-grid-cell-inner">
								<s:property value="#vo.entityId" />
							</div>
						</td>
						<td class=" x-grid-cell x-grid-cell-last"><div
								 style="text-align: left;" class="x-grid-cell-inner">
								<s:url id="u" action="../property/input">
									<s:param name="id">
										<s:property value="#vo.id" />
									</s:param>
								</s:url>
								<ext:button name="修改" onclick='%{"window.open(\'" + #u +"\')"}' />
								<s:url id="u" action="../property/input!delete" includeParams="none">
									<s:param name="id">
										<s:property value="#vo.id" />
									</s:param>
								</s:url> 
								<ext:button name="删除" onclick='%{"jQuery.hiddenRequest(\'" + #u +"\')"}' />
							</div>
						</td>
					</tr>
				</s:iterator>
			</table>
			</div>
			<ext:page page="page" />
		</ext:panel>
		<br/>
		<div
			style="width: 100%; height: 34px; text-align: right; padding: 3px 0px;">
			<ext:button name="保存" onclick="jQuery('#mainForm').submit();" />
		</div>
	</form>
	<%@ include file="/common/foot.jsp"%>
</body>
</html>